/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controldepuntos.clases;

import controldepuntos.pantallas.AAInicio;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import javax.swing.JOptionPane;

/**
 *
 * @author Víctor
 */
public class test {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here 
        
        try{
        Date fecha = new Date();
        DateFormat dfDefault = DateFormat.getInstance();
        DateFormat dfDateInstance = DateFormat.getDateInstance();
        DateFormat dfDateShort = DateFormat.getDateInstance(DateFormat.SHORT);
        DateFormat dfDateMedium = DateFormat.getDateInstance(DateFormat.MEDIUM);
        DateFormat dfDateLong = DateFormat.getDateInstance(DateFormat.LONG);
        DateFormat dfDateFull = DateFormat.getDateInstance(DateFormat.FULL);

        System.out.println("getInstance()=" + dfDefault.format(fecha));
        System.out.println("getDateInstance()=" + dfDateInstance.format(fecha));
        System.out.println("getDateInstance(DateFormat.SHORT)=" + dfDateShort.format(fecha));
        System.out.println("getDateInstance(DateFormat.MEDIUM)=" + dfDateMedium.format(fecha));
        System.out.println("getDateInstance(DateFormat.LONG)=" + dfDateLong.format(fecha));
        System.out.println("getDateInstance(DateFormat.FULL)=" + dfDateFull.format(fecha));
        try { 
            //SimpleDateFormat form = new SimpleDateFormat("dd/MM/yyyy");
            Date fecha2 = dfDateShort.parse("01/01/2016");
            System.out.println("Parsed:" + fecha2);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    
        }catch(Exception ex){
            JOptionPane.showMessageDialog(null, ex.getMessage()+ex.getCause()+" test");
        }
    }
    
    
}
